package com.gitee.kamismile.gatewayAgent.client.bootstrap;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;

/**
 * Created by lidong on 2017/2/13.
 */
@SpringBootApplication
@ImportResource("classpath*:config/*.xml")
@ComponentScan(basePackages = "com.gitee.kamismile.gatewayAgent.client")
@EnableAutoConfiguration(exclude = {
        SecurityAutoConfiguration.class,
        ReactiveSecurityAutoConfiguration.class,
        DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class})
public class ClientApplication {


    public static void main(String[] args) throws Exception {
        ConfigurableApplicationContext ac = new SpringApplicationBuilder(ClientApplication.class)
                .web(WebApplicationType.NONE).run(args);
        GateWayClient gwc = ac.getBean(GateWayClient.class);
        gwc.start();

//        gwc.sendMessage("asdf","{\"token\":\"bc4cdc06-8b62-446a-9d61-a30f884a333f\",\"gameID\":\"1\",\"uid\":\"319797623106572288\"}",1L,"1");
    }


}
